<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="baidu-site-verification" content="SCzNOI2Wq6" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>
        daozhuang
    </title>
    
<link rel="stylesheet" href="/libs/highlight/styles/monokai-sublime.css">

    
<link rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css">

    
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.1"></head>

<body id="bodyx">
    <div class="hd posts">
    <a href="/index.html"><i class="fa fa-reply replay-btn" aria-hidden="true"></i></a>
    <div class="post-title">
        <p>
            Nginx配置ssl证书、配置文件服务器、配置图片服务器
        </p>
        <hr>
    </div>
    <div class="post-content">
        <figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line">user  nobody;</span><br><span class="line">worker_processes  <span class="number">1</span>;</span><br><span class="line">events &#123;</span><br><span class="line">    worker_connections  <span class="number">1024</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">http &#123;</span><br><span class="line">    include       mime.types;</span><br><span class="line">    default_type  application/octet<span class="literal">-stream</span>;</span><br><span class="line"></span><br><span class="line">    sendfile        on;</span><br><span class="line"></span><br><span class="line">    keepalive_timeout  <span class="number">65</span>;</span><br><span class="line"></span><br><span class="line">    server &#123;</span><br><span class="line">        listen       <span class="number">80</span>;</span><br><span class="line">        listen <span class="number">443</span> ssl;</span><br><span class="line">        server_name jifengw.com;</span><br><span class="line">        </span><br><span class="line">        <span class="comment"># 以下代码是  部署的一个 vue 项目</span></span><br><span class="line">		root        /apps/<span class="keyword">static</span>/image/dist;</span><br><span class="line">		</span><br><span class="line">		<span class="comment"># 以下代码是 配置ssl证书  证书位置</span></span><br><span class="line">        ssl_certificate   /apps/nginxSSL/<span class="number">1734311</span>_jifengw.com.pem;</span><br><span class="line">        ssl_certificate_key  /apps/nginxSSL/<span class="number">1734311</span>_jifengw.com.key;</span><br><span class="line">        ssl_session_timeout <span class="number">5</span>m;</span><br><span class="line">        ssl_ciphers ECDHE<span class="literal">-RSA</span><span class="literal">-AES128</span><span class="literal">-GCM</span><span class="literal">-SHA256</span>:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;</span><br><span class="line">        ssl_protocols TLSv1 TLSv1.<span class="number">1</span> TLSv1.<span class="number">2</span>;</span><br><span class="line">        ssl_prefer_server_ciphers on;</span><br><span class="line">        <span class="comment"># 以下代码是配置图片服务器  文件服务器  配置</span></span><br><span class="line">        location /image &#123;</span><br><span class="line">            root /apps/<span class="keyword">static</span>/;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment"># 以下动态代理  代理本机的 Tomcat 8080</span></span><br><span class="line">        location /admin &#123;</span><br><span class="line">            proxy_pass  http://<span class="number">127.0</span>.<span class="number">0.1</span>:<span class="number">8080</span>/;</span><br><span class="line">            client_max_body_size     <span class="number">200</span>m;</span><br><span class="line">            client_body_timeout      <span class="number">10</span>m;</span><br><span class="line">            proxy_connect_timeout    <span class="number">10</span>m;</span><br><span class="line">            proxy_read_timeout      <span class="number">10</span>m;</span><br><span class="line">            proxy_send_timeout      <span class="number">10</span>m;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment"># 以下动态代理  代理本机的 Tomcat 8080</span></span><br><span class="line">        location /eduadmin &#123;</span><br><span class="line">            client_max_body_size     <span class="number">200</span>m;</span><br><span class="line">            client_body_timeout      <span class="number">10</span>m;</span><br><span class="line">            proxy_connect_timeout    <span class="number">10</span>m;</span><br><span class="line">            proxy_read_timeout      <span class="number">10</span>m;</span><br><span class="line">            proxy_send_timeout      <span class="number">10</span>m;</span><br><span class="line">            proxy_pass  http://<span class="number">127.0</span>.<span class="number">0.1</span>:<span class="number">8090</span>/;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>


    </div>

    
        <hr class="fhr">
        <div id="vcomments"></div>
    
</div>
    <div class="footer" id="footer">
    <p>Copyright © 2020 <a class="flink" href="https://hexo.io" target="_blank" rel="noopener">Hexo</a>-<a class="flink" href="https://github.com/sanjinhub/hexo-theme-geek" target="_blank" rel="noopener">Geek</a>.
        <label class="el-switch el-switch-green el-switch-sm" style="vertical-align: sub;">
            <input type="checkbox" name="switch" id="update_style">
            <span class="el-switch-style"></span>
        </label>
<!--         <script type="text/javascript">
        var cnzz_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
        document.write(unescape("%3Cspan id='cnzz_stat_icon_1278548644'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "v1.cnzz.com/stat.php%3Fid%3D1278548644%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
        </script> -->
    </p>
</div>
<input type="hidden" id="web_style" value="black">
<input type="hidden" id="valine_appid" value="c994h5wXLa8fSMa424BTyVhs-gzGzoHsz">
<input type="hidden" id="valine_appKey" value="4tFbwCi4sYo3yRFgiNFpQd4N">

<script src="/libs/jquery.min.js"></script>


<script src="/libs/highlight/highlight.pack.js"></script>

<script src='//cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>

<script src="/js/js.js"></script>

<style type="text/css">
.v * {
    color: #698fca;
}

.v .vlist .vcard .vhead .vsys {
    color: #3a3e4a;
}

.v .vlist .vcard .vh .vmeta .vat {
    color: #638fd5;
}

.v .vlist .vcard .vhead .vnick {
    color: #6ba1ff;
}

.v a {
    color: #8696b1;
}

.v .vlist .vcard .vhead .vnick:hover {
    color: #669bfc;
}
</style>
</body>

</html>